package com.juvepoland.jpdroid.models;

import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

 public class News {
	
	public static final String D_ID				="id";
	public static final String D_CONTENT		="content";
	public static final String D_TITLE			="title";
	public static final String D_SOURCE			="source";
	public static final String D_DATE			="unixtime";
	public static final String D_COMMENTS_COUNT	="comments_count";
	public static final String D_COMMENTS_ENABLED		="comments";

	private int id;
	private String title;
	private String content;
	private int commentsCount;
	private Date date;
	private String source;
	private List<Comment> comments;
	private boolean event;
	private int commentEnabled;
	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public int getCommentsCount() {
		return commentsCount;
	}
	public void setCommentsCount(int commentsCount) {
		this.commentsCount = commentsCount;
	}
	public Date getDate() {
		return date;
	}
	public String getStringDate(){
		 Format formatter = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
		 return formatter.format(getDate());
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public void setDate(long timestamp){
		Date d = new Date();
		timestamp = timestamp*1000;
		d.setTime(timestamp);
		this.setDate(d);
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	public List<Comment> getComments() {
		return comments;
	}
	public void setComments(List<Comment> comments) {
		this.comments = comments;
	}
	public boolean isEvent() {
		return event;
	}
	public void setEvent(boolean event) {
		this.event = event;
	}
	public int getCommentEnabled() {
		return commentEnabled;
	}
	public void setCommentEnabled(int commentEnabled) {
		this.commentEnabled = commentEnabled;
	}
	
	
}
